package BSQX_Bit;

import java.util.Arrays;

import java.util.*;
import java.util.Scanner;

public class BSQX_3_19 {
    //计算平均值
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int[] arr=new int[3*n];
        //将每个队员的水平值输入
        for (int i = 0; i < 3*n; i++) {
            //System.out.println("请输入第"+(i+1)+"号队员水平值");
            int k= scanner.nextInt();
            arr[i]=k;
        }
        Arrays.sort(arr);
        int sum=0;//这里只能用long不能用int,数据量太大,int放不下,注意点!!!!
        int k=arr.length-2;
        for (int i = 0; i < n; i++) {
            sum+=arr[k];
            k-=2;
        }
        System.out.println(sum);
    }



//    这个题作对了:删除公共字符
   /*public static void main(String[] args) {
       Scanner scanner=new Scanner(System.in);
       String str1=new String();
       str1=scanner.nextLine();
       String str2=new String();
       str2=scanner.nextLine();
      *//* String str1="They are students.";
       String str2="aeiou";*//*
       String str3=func2(str1,str2);
       System.out.println(str3);

   }
    public  static  String func2(String str1 ,String str2){
        StringBuilder stringBuilder=new StringBuilder();
        HashSet<Character> set=new HashSet<>();
        for (int i = 0; i < str2.length(); i++) {
            char ch=str2.charAt(i);
            if (!set.contains(ch)){
                set.add(ch);
            }
        }
        for (int i = 0; i < str1.length(); i++) {
            char ch=str1.charAt(i);
            if (!set.contains(ch)){
                stringBuilder.append(ch);
            }
        }
        return  stringBuilder.toString();
    }*/
}
